Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-funnel

Package Overview
Dependencies
Maintainers
3
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-funnel

Broccoli plugin that allows you to filter files selected from an input node down based on regular expressions.

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
788K
increased by2.09%
Maintainers
3
Weekly downloads
 
Created

What is broccoli-funnel?

broccoli-funnel is a Broccoli plugin that allows you to filter and move files around within a Broccoli build pipeline. It is commonly used to include or exclude specific files or directories, rename files, and restructure the output directory tree.

What are broccoli-funnel's main functionalities?

Filtering Files

This feature allows you to filter files based on a pattern. In this example, only JavaScript files from the 'src' directory are included in the output.

const Funnel = require('broccoli-funnel');
const filteredTree = new Funnel('src', {
  include: ['**/*.js']
});

Excluding Files

This feature allows you to exclude files based on a pattern. In this example, all test JavaScript files are excluded from the 'src' directory.

const Funnel = require('broccoli-funnel');
const filteredTree = new Funnel('src', {
  exclude: ['**/*.test.js']
});

Renaming Files

This feature allows you to rename files during the build process. In this example, 'index.html' is renamed to 'main.html'.

const Funnel = require('broccoli-funnel');
const renamedTree = new Funnel('src', {
  getDestinationPath: function(relativePath) {
    if (relativePath === 'index.html') {
      return 'main.html';
    }
    return relativePath;
  }
});

Moving Files

This feature allows you to move files to a different directory. In this example, all files from the 'src' directory are moved to the 'output' directory.

const Funnel = require('broccoli-funnel');
const movedTree = new Funnel('src', {
  destDir: 'output'
});

Other packages similar to broccoli-funnel

Keywords

FAQs

Package last updated on 19 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc